<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:pe="http://primefaces.org/ui/extensions">

<h:head></h:head>

<h:body>
    <h:form>
        <p:commandLink value="Show" onclick="PF('wVar').show();"/>
    </h:form>
    <p:dialog widgetVar="wVar" minWidth="400" modal="true" appendToBody="true">
        <h:form>
            <div>
            <pe:masterDetail id="masterDetail" level="#{wizardMasterDetailController.currentLevel}"
                             showAllBreadcrumbItems="true" showBreadcrumb="true">

                <pe:masterDetailLevel level="1" levelLabel="A">
                    <h:outputText value="A"/>
                    <p:commandButton value="Next" process="masterDetail"  update="@form">
                        <pe:selectDetailLevel/>
                    </p:commandButton>
                </pe:masterDetailLevel>

                <pe:masterDetailLevel level="2" levelLabel="B">
                    <h:outputText value="B"/>
                    <p:commandButton value="Back" process="@this" immediate="true" update="@form">
                        <pe:selectDetailLevel step="-1"/>
                    </p:commandButton>
                </pe:masterDetailLevel>
            </pe:masterDetail>
            </div>
        </h:form>
    </p:dialog>
</h:body>
</html>
